﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

using MVVMPresentation.Model;

namespace MVVMPresentation.ViewModel
{
   public class CustomerViewModel : ObservableObject
   {
      private Customer m_Customer;

      public string Name
      {
         get
         {
            return m_Customer.Name;
         }
         set
         {
            if (m_Customer.Name != value)
            {
               m_Customer.Name = value;
               RaisePropertyChanged("Name");
            }
         }
      }

      public string Surname
      {
         get
         {
            return m_Customer.Surname;
         }
         set
         {
            if (m_Customer.Surname != value)
            {
               m_Customer.Surname = value;
               RaisePropertyChanged("Surname");
            }
         }
      }

      public string Address
      {
         get
         {
            return m_Customer.Address;
         }
         set
         {
            if (m_Customer.Address != value)
            {
               m_Customer.Address = value;
               RaisePropertyChanged("Address");
            }
         }
      }

      public string PhoneNo
      {
         get
         {
            return m_Customer.PhoneNo;
         }
         set
         {
            if (m_Customer.PhoneNo != value)
            {
               m_Customer.PhoneNo = value;
               RaisePropertyChanged("PhoneNo");
            }
         }
      }

      public CustomerViewModel()
      {
         m_Customer = new Customer();
      }
   }
}
